package Entidades;

public class Coordenada {
	int posX;
	int posY;
	int nroPlanta;

	public Coordenada() {
		super();
	}

	public Coordenada(int posX, int posY, int nroPlanta) {
		super();
		this.posX = posX;
		this.posY = posY;
		this.nroPlanta = nroPlanta;
	}

	public Coordenada(Coordenada c) {
		this.posX = new Integer(c.posX);
		this.posY = new Integer(c.posY);
		this.nroPlanta = new Integer(c.nroPlanta);
	}

	public void setearPosicionX(int x) {
		this.posX = x;
	}

	public void setearPosicionY(int y) {
		this.posY = y;
	}

	public int obtenerPosicionX() {
		return this.posX;
	}

	public int obtenerPosicionY() {
		return this.posY;
	}

	public void setearNroPlanta(int nroP) {
		this.nroPlanta = nroP;
	}

	public int obtenerNroPlanta() {
		return this.nroPlanta;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + nroPlanta;
		result = prime * result + posX;
		result = prime * result + posY;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Coordenada other = (Coordenada) obj;
		if (nroPlanta != other.nroPlanta)
			return false;
		if (posX != other.posX)
			return false;
		if (posY != other.posY)
			return false;
		return true;
	}

	@Override
	public String toString() {
		// return "(" + posX + ", " + posY + ") : " + nroPlanta;
		return "(" + posX + ";" + posY + ")";
	}

}
